﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using RuleCode.Table;

namespace chatblog.login
{
    public partial class login1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                cbuser.dealcookie();
                dealrequest();
                //bind1();
                //bind2();
                //bind3();
            }
        }

        /// <summary>
        /// 处理request
        /// </summary>
        private void dealrequest()
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (cbuser.login(TextBox1.Text,
                        TextBox2.Text) == false)
            {
                MessageBox.Show(this.Page, "用户名或者密码错误.");
                return;
            }
            if (this.Request.Params["redirecturl"] == null)
            {
                this.Response.Redirect(ResolveUrl("~/story.aspx"));
            }
            else
            {
                this.Response.Redirect(this.Request.Params["redirecturl"].ToString());
            }
        }
    }
}
